package com.ly.heart.service.impl;

import java.util.Collections;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.ly.common.utils.DateUtils;
import com.ly.heart.domain.dto.KingPurchaseApplyQueryDto;
import com.ly.heart.domain.vo.KingPurchaseApplyVo;
import com.ly.heart.mapper.KingPurchaseApplyMaterialMapper;
import com.ly.heart.service.IKingPurchaseApplyMaterialService;
import org.springframework.stereotype.Service;
import com.ly.heart.domain.KingPurchaseApplyMaterialEntity;

import javax.annotation.Resource;

/**
 * 金蝶-采购申请单物料信息Service业务层处理
 *
 * @author cxl
 * @date 2024-08-31
 */
@Service
public class KingPurchaseApplyMaterialServiceImpl extends ServiceImpl<KingPurchaseApplyMaterialMapper,KingPurchaseApplyMaterialEntity> implements IKingPurchaseApplyMaterialService {

    @Resource
    private KingPurchaseApplyMaterialMapper kingPurchaseApplyMaterialMapper;

    /**
     * 查询金蝶-采购申请单物料信息
     *
     * @param id 金蝶-采购申请单物料信息ID
     * @return 金蝶-采购申请单物料信息
     */
    @Override
    public KingPurchaseApplyMaterialEntity selectKingPurchaseApplyMaterialEntityById(String id)
    {
        return kingPurchaseApplyMaterialMapper.selectKingPurchaseApplyMaterialEntityById(id);
    }

    /**
     * 查询金蝶-采购申请单物料信息列表
     *
     * @param kingPurchaseApplyMaterialEntity 金蝶-采购申请单物料信息
     * @return 金蝶-采购申请单物料信息
     */
    @Override
    public List<KingPurchaseApplyMaterialEntity> selectKingPurchaseApplyMaterialEntityList(KingPurchaseApplyMaterialEntity kingPurchaseApplyMaterialEntity)
    {
        return kingPurchaseApplyMaterialMapper.selectKingPurchaseApplyMaterialEntityList(kingPurchaseApplyMaterialEntity);
    }

    /**
     * 新增金蝶-采购申请单物料信息
     *
     * @param kingPurchaseApplyMaterialEntity 金蝶-采购申请单物料信息
     * @return 结果
     */
    @Override
    public int insertKingPurchaseApplyMaterialEntity(KingPurchaseApplyMaterialEntity kingPurchaseApplyMaterialEntity)
    {
        kingPurchaseApplyMaterialEntity.setCreateTime(DateUtils.getNowDate());
        return kingPurchaseApplyMaterialMapper.insertKingPurchaseApplyMaterialEntity(kingPurchaseApplyMaterialEntity);
    }

    /**
     * 修改金蝶-采购申请单物料信息
     *
     * @param kingPurchaseApplyMaterialEntity 金蝶-采购申请单物料信息
     * @return 结果
     */
    @Override
    public int updateKingPurchaseApplyMaterialEntity(KingPurchaseApplyMaterialEntity kingPurchaseApplyMaterialEntity)
    {
        return kingPurchaseApplyMaterialMapper.updateKingPurchaseApplyMaterialEntity(kingPurchaseApplyMaterialEntity);
    }

    /**
     * 批量删除金蝶-采购申请单物料信息
     *
     * @param ids 需要删除的金蝶-采购申请单物料信息ID
     * @return 结果
     */
    @Override
    public int deleteKingPurchaseApplyMaterialEntityByIds(String[] ids)
    {
        return kingPurchaseApplyMaterialMapper.deleteKingPurchaseApplyMaterialEntityByIds(ids);
    }

    /**
     * 删除金蝶-采购申请单物料信息信息
     *
     * @param id 金蝶-采购申请单物料信息ID
     * @return 结果
     */
    @Override
    public int deleteKingPurchaseApplyMaterialEntityById(String id)
    {
        return kingPurchaseApplyMaterialMapper.deleteKingPurchaseApplyMaterialEntityById(id);
    }

    @Override
    public List<KingPurchaseApplyVo> getPurchaseApplyList(KingPurchaseApplyQueryDto queryDto) {
        return kingPurchaseApplyMaterialMapper.getPurchaseApplyList(queryDto);
    }
}
